(0) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
isort(Nil, r) → Nil
insert(S(x), r) → insert[Ite](<(S(x), x), S(x), r)
inssort(xs) → isort(xs, Nil)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0, S(y)) → True
<(x, 0) → False
insert[Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite](True, x, r) → Cons(x, r)
Rewrite Strategy: INNERMOST
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
isort(Nil, r) → Nil
insert(S(x), r) → insert[Ite](<(S(x), x), S(x), r)
inssort(xs) → isort(xs, Nil)
The (relative) TRS S consists of the following rules:
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite](True, x, r) → Cons(x, r)
Rewrite Strategy: INNERMOST
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
Innermost TRS:
Rules:
isort(Cons(x, xs), r) → isort(xs, insert(x, r))
isort(Nil, r) → Nil
insert(S(x), r) → insert[Ite](<(S(x), x), S(x), r)
inssort(xs) → isort(xs, Nil)
<(S(x), S(y)) → <(x, y)
<(0', S(y)) → True
<(x, 0') → False
insert[Ite](False, x', Cons(x, xs)) → Cons(x, insert(x', xs))
insert[Ite](True, x, r) → Cons(x, r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
isort,
insert,
<They will be analysed ascendingly in the following order:
insert < isort
< < insert
(6) Obligation:
Innermost TRS:
Rules:
isort(
Cons(
x,
xs),
r) →
isort(
xs,
insert(
x,
r))
isort(
Nil,
r) →
Nilinsert(
S(
x),
r) →
insert[Ite](
<(
S(
x),
x),
S(
x),
r)
inssort(
xs) →
isort(
xs,
Nil)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falseinsert[Ite](
False,
x',
Cons(
x,
xs)) →
Cons(
x,
insert(
x',
xs))
insert[Ite](
True,
x,
r) →
Cons(
x,
r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))
The following defined symbols remain to be analysed:
<, isort, insert
They will be analysed ascendingly in the following order:
insert < isort
< < insert
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
<(
gen_S:0'5_0(
n7_0),
gen_S:0'5_0(
+(
1,
n7_0))) →
True, rt ∈ Ω(0)
Induction Base:
<(gen_S:0'5_0(0), gen_S:0'5_0(+(1, 0))) →RΩ(0)
True
Induction Step:
<(gen_S:0'5_0(+(n7_0, 1)), gen_S:0'5_0(+(1, +(n7_0, 1)))) →RΩ(0)
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) →IH
True
We have rt ∈ Ω(1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n0).
(8) Complex Obligation (BEST)
(9) Obligation:
Innermost TRS:
Rules:
isort(
Cons(
x,
xs),
r) →
isort(
xs,
insert(
x,
r))
isort(
Nil,
r) →
Nilinsert(
S(
x),
r) →
insert[Ite](
<(
S(
x),
x),
S(
x),
r)
inssort(
xs) →
isort(
xs,
Nil)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falseinsert[Ite](
False,
x',
Cons(
x,
xs)) →
Cons(
x,
insert(
x',
xs))
insert[Ite](
True,
x,
r) →
Cons(
x,
r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)
Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))
The following defined symbols remain to be analysed:
insert, isort
They will be analysed ascendingly in the following order:
insert < isort
(10) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
insert(
gen_S:0'5_0(
1),
gen_Cons:Nil4_0(
n240_0)) →
*6_0, rt ∈ Ω(n240
0)
Induction Base:
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(0))
Induction Step:
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(+(n240_0, 1))) →RΩ(1)
insert[Ite](<(S(gen_S:0'5_0(0)), gen_S:0'5_0(0)), S(gen_S:0'5_0(0)), gen_Cons:Nil4_0(+(n240_0, 1))) →RΩ(0)
insert[Ite](False, S(gen_S:0'5_0(0)), gen_Cons:Nil4_0(+(1, n240_0))) →RΩ(0)
Cons(0', insert(S(gen_S:0'5_0(0)), gen_Cons:Nil4_0(n240_0))) →IH
Cons(0', *6_0)
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(11) Complex Obligation (BEST)
(12) Obligation:
Innermost TRS:
Rules:
isort(
Cons(
x,
xs),
r) →
isort(
xs,
insert(
x,
r))
isort(
Nil,
r) →
Nilinsert(
S(
x),
r) →
insert[Ite](
<(
S(
x),
x),
S(
x),
r)
inssort(
xs) →
isort(
xs,
Nil)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falseinsert[Ite](
False,
x',
Cons(
x,
xs)) →
Cons(
x,
insert(
x',
xs))
insert[Ite](
True,
x,
r) →
Cons(
x,
r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(n240_0)) → *6_0, rt ∈ Ω(n2400)
Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))
The following defined symbols remain to be analysed:
isort
(13) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol isort.
(14) Obligation:
Innermost TRS:
Rules:
isort(
Cons(
x,
xs),
r) →
isort(
xs,
insert(
x,
r))
isort(
Nil,
r) →
Nilinsert(
S(
x),
r) →
insert[Ite](
<(
S(
x),
x),
S(
x),
r)
inssort(
xs) →
isort(
xs,
Nil)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falseinsert[Ite](
False,
x',
Cons(
x,
xs)) →
Cons(
x,
insert(
x',
xs))
insert[Ite](
True,
x,
r) →
Cons(
x,
r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(n240_0)) → *6_0, rt ∈ Ω(n2400)
Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))
No more defined symbols left to analyse.
(15) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(n240_0)) → *6_0, rt ∈ Ω(n2400)
(16) BOUNDS(n^1, INF)
(17) Obligation:
Innermost TRS:
Rules:
isort(
Cons(
x,
xs),
r) →
isort(
xs,
insert(
x,
r))
isort(
Nil,
r) →
Nilinsert(
S(
x),
r) →
insert[Ite](
<(
S(
x),
x),
S(
x),
r)
inssort(
xs) →
isort(
xs,
Nil)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falseinsert[Ite](
False,
x',
Cons(
x,
xs)) →
Cons(
x,
insert(
x',
xs))
insert[Ite](
True,
x,
r) →
Cons(
x,
r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(n240_0)) → *6_0, rt ∈ Ω(n2400)
Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))
No more defined symbols left to analyse.
(18) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
insert(gen_S:0'5_0(1), gen_Cons:Nil4_0(n240_0)) → *6_0, rt ∈ Ω(n2400)
(19) BOUNDS(n^1, INF)
(20) Obligation:
Innermost TRS:
Rules:
isort(
Cons(
x,
xs),
r) →
isort(
xs,
insert(
x,
r))
isort(
Nil,
r) →
Nilinsert(
S(
x),
r) →
insert[Ite](
<(
S(
x),
x),
S(
x),
r)
inssort(
xs) →
isort(
xs,
Nil)
<(
S(
x),
S(
y)) →
<(
x,
y)
<(
0',
S(
y)) →
True<(
x,
0') →
Falseinsert[Ite](
False,
x',
Cons(
x,
xs)) →
Cons(
x,
insert(
x',
xs))
insert[Ite](
True,
x,
r) →
Cons(
x,
r)
Types:
isort :: Cons:Nil → Cons:Nil → Cons:Nil
Cons :: S:0' → Cons:Nil → Cons:Nil
insert :: S:0' → Cons:Nil → Cons:Nil
Nil :: Cons:Nil
S :: S:0' → S:0'
insert[Ite] :: True:False → S:0' → Cons:Nil → Cons:Nil
< :: S:0' → S:0' → True:False
inssort :: Cons:Nil → Cons:Nil
0' :: S:0'
True :: True:False
False :: True:False
hole_Cons:Nil1_0 :: Cons:Nil
hole_S:0'2_0 :: S:0'
hole_True:False3_0 :: True:False
gen_Cons:Nil4_0 :: Nat → Cons:Nil
gen_S:0'5_0 :: Nat → S:0'
Lemmas:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)
Generator Equations:
gen_Cons:Nil4_0(0) ⇔ Nil
gen_Cons:Nil4_0(+(x, 1)) ⇔ Cons(0', gen_Cons:Nil4_0(x))
gen_S:0'5_0(0) ⇔ 0'
gen_S:0'5_0(+(x, 1)) ⇔ S(gen_S:0'5_0(x))
No more defined symbols left to analyse.
(21) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(1) was proven with the following lemma:
<(gen_S:0'5_0(n7_0), gen_S:0'5_0(+(1, n7_0))) → True, rt ∈ Ω(0)
(22) BOUNDS(1, INF)